class Person {
    name = "张三";
    age = 18;
    static nationality = 'China';
    readonly gender = 'male';
    static readonly planet = 'Earth';

    sayHello() {
        console.log('Hello');
    }
}

const p = new Person();
console.log(p);
console.log(Person.nationality);
console.log(p.gender);
// p.gender = 'female'; // 报错
console.log(Person.planet);
p.sayHello()